package com.yzyz.bean.route;

import java.util.Date;
import java.util.List;

import com.yzyz.bean.BaseBean;
import com.yzyz.bean.scenic.ScenicBean;
import com.yzyz.utils.ValidateUtils;

/**
 * 行程
 * @author David Sun
 * @Date   2010-3-28
 *
 */
public class RouteBean extends BaseBean {
	private static final long serialVersionUID = -7153584111980030344L;
	private String price;
	private Date date;
	private String contents;//行程内容
	private int routeGroupId;
	private List<ScenicBean> scenics;//相关的景区

	public List<ScenicBean> getScenics() {
		return scenics;
	}
	public void setScenics(List<ScenicBean> scenics) {
		this.scenics = scenics;
	}
	public int getRouteGroupId() {
		return routeGroupId;
	}
	public void setRouteGroupId(int routeGroupId) {
		this.routeGroupId = routeGroupId;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public String getContents() {
		return contents;
	}
	public void setContents(String contents) {

		this.contents = contents;
	}
	
	public RouteBean(RouteBean route) {
		this.available 	= route.isAvailable();
		this.contents 	= route.getContents();
		this.date 		= route.getDate();
		this.id 		= route.getId();
		this.name 		= route.getName();
		this.price 		= route.getPrice();
		this.level 		= route.getLevel();
		this.routeGroupId = route.getRouteGroupId();
		
	}
	
	public RouteBean() {
	}
		
	@Override
	public boolean equals(Object obj) {
		if(obj == null){
			return false;
		}
		if(obj instanceof RouteBean){
			if(!super.equals(obj)){
				return false;
			}
			RouteBean route = (RouteBean)obj;
			if(!ValidateUtils.isEquals(this.price, route.getPrice())){
				return false;
			}
			if(!ValidateUtils.isEquals(this.contents, contents)){
				return false;
			}
			if(this.routeGroupId != route.getRouteGroupId()){
				return false;
			}
			return true;
		}
		return false;
	}
}
